<?php
ini_set('date.timezone','Asia/Shanghai');
ini_set("display_errors", "On");
require_once ('fyapi.php');

$type= isset($_POST["type"])?$_POST["type"]:'';
$phone = isset($_POST["phone"])?$_POST["phone"]:'';
$id = isset($_POST["id"])?$_POST["id"]:'';
$ret = null;
$data = file_get_contents("php://input");


$feiyuApi = new FeiyuApi();
switch ($type) {
	case 'call':
		$ret = $feiyuApi->callBackUrlAction($id,'86'.$phone);
		break;
	case 'phone':
		$ret = $feiyuApi->modifyAccountDisplayNumberAction($id,'86'.$phone);
		break;
	case 'status':
		$ret = $feiyuApi->getAccountUrlAction($id);
		break;
	case 'add':
		$ret = $feiyuApi->addAccountUrlAction($id,'86'.$phone);
		break;
	
	default:
		# code...
		break;
}
return $data;


